package com.bitdf.txing.product.feign;

import com.bitdf.txing.common.to.SkuReductionTo;
import com.bitdf.txing.common.utils.R;
import com.bitdf.txing.product.config.FeignInterceptor;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * 远程调用秒杀服务
 */
@FeignClient(
        name = "tx-mall-seckill",                 // 服务名称
        configuration = FeignInterceptor.class       // 请求拦截器 （关键代码）
)
public interface ProductSeckillFeginService {
    @GetMapping("/txing/mall/seckill/sku/seckill/{skuId}")
    public R getSkuSeckillInfo(@PathVariable("skuId") Long skuId);

    /**
     *
     * @param skuReductionTo
     * @return
     */
    @PostMapping("/txing/mall/seckill/coupon/skufullreduction/skuto/save")
    R saveSkuReduction(@RequestBody SkuReductionTo skuReductionTo);
}
